﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MengLin.OOP.DesignPattern.Observer.IPhoneXPriceDown.Models
{
    /// <summary>
    /// 老板
    /// </summary>
    public class Boss
    {
        public string Boss_Id { get; set; }

        public string Boss_Name { get; set; }

        public int Age { get; set; }

        /// <summary>
        /// 买IPhoneX
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void Buy(object sender, EventArgs e)
        {
            IPhoneX iPhoneX = (IPhoneX)sender;
            Console.WriteLine($"I am the {nameof(Boss)}，This is {iPhoneX.IPhoneX_Version} IPhoneX！");

            IPhoneXEventArgs iPhoneXEventArgs = (IPhoneXEventArgs)e;
            Console.WriteLine($"之前价格{iPhoneXEventArgs.OldPrice}");
            Console.WriteLine($"现在价格{iPhoneXEventArgs.NewPrice}");
            Console.WriteLine("果断买了！");
        }
    }
}
